<!--验证浏览器是否支持-->
<script type="text/javascript">
  if (window != parent) {
    window.top.location.href = window.location.href;
  }


  function getOSType() {
    if (/(Android)/i.test(navigator.userAgent)) {
      return 0;
    } else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
      return 1;
    } else {
      return 2;
    }
  }

  //js判断当前环境是否是微信环境
  function is_weixin() {
    var ua = navigator.userAgent.toLowerCase();
    if (ua.match(/MicroMessenger/i) == "micromessenger") {
      return true;
    } else {
      return false;
    }
  }

  function getBrowserInfo() {
    var agent = navigator.userAgent.toLowerCase();
    var regStr_ie = /msie [\d.]+;/gi;
    var regStr_ff = /firefox\/[\d.]+/gi
    var regStr_chrome = /chrome\/[\d.]+/gi;
    var regStr_saf = /safari\/[\d.]+/gi;
    // IE
    if (agent.indexOf("msie") > 0) {
      return agent.match(regStr_ie);
    }
    // firefox
    if (agent.indexOf("firefox") > 0) {
      return agent.match(regStr_ff);
    }
    // Chrome
    if (agent.indexOf("chrome") > 0) {
      return agent.match(regStr_chrome);
    }
    // Safari
    if (agent.indexOf("safari") > 0 && agent.indexOf("chrome") < 0) {
      return agent.match(regStr_saf);
    }
    return ""
  }
  (function () {
    var browser = getBrowserInfo();
    var verInfo = (browser + "").replace(/[^0-9.]/ig, "");
    if ((browser + "").indexOf("msie") >= 0) {
      if (parseFloat(verInfo) < 10.0) {
        window.onload = function () {
          var lowestSupportedIEVersion = 10;
          var el = document.createElement('div'),
            elStyle = el.style,
            docBody = document.getElementsByTagName('body')[0],
            linkStyle = 'color:#06F;text-decoration: underline;';
          el.innerHTML = '尊敬的用户：<br />' +
            '您的Internet Explorer浏览器版本太低。为了让你得到最佳的体验效果，访问本网站需要安装Internet Explorer更新版本的浏览器，' +
            '请<a href="//windows.microsoft.com/zh-cn/internet-explorer/download-ie" style="' +
            linkStyle +
            '" target="_blank">下载安装IE' + lowestSupportedIEVersion + '</a>（或更新）。' +
            '也可以在其他浏览器，' +
            '如<a href="//dl.softmgr.qq.com/original/Browser/75.0.3770.142_chrome_installer_32.exe" style="' + linkStyle +
            '" target="_blank">Chrome</a>' +
            '或<a href="//www.firefox.com.cn/download/" style="' + linkStyle +
            '" target="_blank">Firefox</a>火狐中打开本网站。';
          // elStyle.width = '100%';
          elStyle.width = '720px';
          elStyle.color = '#000';
          elStyle.fontSize = '14px';
          elStyle.lineHeight = '180%';
          elStyle.margin = '60px auto';
          elStyle.backgroundColor = '#fffbd5';
          elStyle.border = '1px solid #CCC';
          elStyle.padding = '24px 48px';
          docBody.innerHTML = '';
          docBody.appendChild(el);
        }
      }
    }
  }());

</script>

<!--手机上禁止字体放大-->
<script type="text/javascript">
  (function () {
    if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
      handleFontSize();
    } else {
      if (document.addEventListener) {
        document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
      } else if (document.attachEvent) {
        document.attachEvent("WeixinJSBridgeReady", handleFontSize);
        document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
      }
    }

    function handleFontSize() {
      // 设置网页字体为默认大小
      WeixinJSBridge.invoke('setFontSizeCallback', {
        'fontSize': 0
      });
      // 重写设置网页字体大小的事件
      WeixinJSBridge.on('menu:setfont', function () {
        WeixinJSBridge.invoke('setFontSizeCallback', {
          'fontSize': 0
        });
      });
    }
  })();

</script>
